<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/js/axios.min.js"></script>
<script src="/js/util.js"></script>
<script>
    function userLogin() {
        let formData = new FormData();
        formData.append("username", $("username").value);
        formData.append("password", $("password").value)
        axios.post("/user/login", formData).then(resp => {
            console.log(resp.data);
            if (resp.data != "") {
                location.href = "/index.html";
            } else {
                $("loginSpan").innerHTML = "登陆失败";
            }
        })
    }
</script>
<body>
用户名：<input type="text" id="username"><br>
密码：<input type="password" id="password"><br>
<input type="button" value="登陆" onclick="userLogin()"><span id="loginSpan"></span>
</body>
</html>